package cn.edu.scau.cmi.wujiaxian.exercise10;

import java.util.InputMismatchException;
import java.util.Scanner;

public class Fenxi {
	
	@SuppressWarnings("resource")
	public static double getTotalScore(String s) {
		Scanner scanner = new Scanner(s);
		scanner.useDelimiter("[^0123456789.]+");
		double totalScore = 0;
		while (scanner.hasNext()) {
			try {
				double score = scanner.nextDouble();
				totalScore += score;
			} catch (InputMismatchException e) {
				scanner.next();
			}
		}
		System.out.println(totalScore);
		return totalScore;
	}
	
}
